# -*- coding: utf-8 -*-

from src import boto, config, json


config.set('Credentials', 'gs_access_key_id', 'GOOG2JHE42YSAUYWBN6Z')
config.set('Credentials', 'gs_secret_access_key', 'Eiz+D+wRGXH3n8B5N0cmdbUeXnaWOBjZ/nDhmP5S')

#config.set('Credentials', 'gs_access_key_id', 'GOOG6TODSQZPSZC3CUAK')
#config.set('Credentials', 'gs_secret_access_key', 'hWnw1c83ozQj4LIvdB9a8fdT3ZZOLfACo6zMyo7O')

# URI scheme for Google Storage.
GOOGLE_STORAGE = 'gs'
# URI scheme for accessing local files.
LOCAL_FILE = 'file'



def ls():

    keys = boto.storage_uri('1988','gs').get_bucket().list('movies/')
    for k in keys:
        print k.name,
        print k.get_acl()

    
    #key = boto.storage_uri('1988/movies/a.c', 'gs').get_key()
#    key = boto.storage_uri('1988/movies/龙猫.rmvb', 'gs').get_key()
#    print key.get_acl()

    #bucket = boto.storage_uri('1988', 'gs').get_bucket()
#    #print dir(bucket)
    #bucket.add_user_grant('FULL_CONTROL','00b4903a97751381831c7c7e3a87200f6574447df8d30eef2ef539e1260356d7')
#    bucket.add_email_grant('FULL_CONTROL','xuminzhong@gmail.com')
#    #print isPublic(bucket)
#    print bucket.get_acl()
#    print '=' * 20
#    print bucket.get_xml_acl()


ls()
